package com.ls.utils;

import java.util.concurrent.atomic.AtomicInteger;

import org.apache.commons.pool2.PooledObject;
import org.apache.commons.pool2.PooledObjectFactory;

public class ApachePools {

}

class MyPoolFactory implements PooledObjectFactory{
	private AtomicInteger count = new AtomicInteger(0);

	@Override
	public PooledObject makeObject() throws Exception {
		int a = count.getAndIncrement();
		System.out.println(a+" is created");
		
		return null;
	}

	@Override
	public void destroyObject(PooledObject p) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean validateObject(PooledObject p) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void activateObject(PooledObject p) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void passivateObject(PooledObject p) throws Exception {
		// TODO Auto-generated method stub
		
	}
}